home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
comm2
/
mmesec10.lha
/
MM
/
Rexx
/
MM_EstadisEcos.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-05-14
|
26KB
|
820 lines
/*
EstadisEcos.rexx
(c) Ferran Delriu - 07-10-1993
v1.0 a v2.2
MM_EstadisEcos.rexx
(c) Ferran Delriu - 15-05-1996
Amiga-Penedes BBS 34-3-817-24-40
2:343/119.0@fidonet
39:190/1.0@amiganet
E-Mail fdelriu@redestb.es
$VER: MM_EstadisEcos.rexx v1.0 by Ferran Delriu
*/
ver="MM_EstadisEcos.rexx v1.0 by Ferran Delriu"
signal on break_c
signal on halt
signal on syntax
signal on ioerr
options results
address command
if ~show('l','rexxmathlib.library') then do
call addlib('rexxmathlib.library',0,-30)
end
if ~show('l','rexxsupport.library') then do
call addlib('rexxsupport.library',0,-30)
end
if ~show('l','rexxarplib.library') then do
call addlib('rexxarplib.library',0,-30)
end
/*activa MAILMANAGER si no esta activo*/
address command('waitforport MAILMANAGER')
if rc>0 then do
address command('run <>NIL: mm:bin/mm')
address command('waitforport MAILMANAGER')
if rc>0 then do
say 'Hay algun problema con el MAILER.. SORRY.'
exit
end
end
/*inicia reloj*/
r=time('r')
address 'MAILMANAGER'
MM.LogLevel=2
CALL WriteLog('MM_EstadisEcos.rexx - Entrada')
address command
/*asignacion variables*/
MesTexto="JanFebMarAprMayJunJulAugSepOctNovDec"
HoraTexto.1="00:00-03:00"
HoraTexto.2="03:00-06:00"
HoraTexto.3="06:00-09:00"
HoraTexto.4="09:00-12:00"
HoraTexto.5="12:00-15:00"
HoraTexto.6="15:00-18:00"
HoraTexto.7="18:00-21:00"
HoraTexto.8="21:00-00:00"
log=""
/*Lee fichero EstadisEcos.cfg*/
Tag.="";Ecos=0;totalcfg=0
if open('source','MM:config/MM_EstadisEcos.cfg') then do
do while eof('source')~=1
linea=readln('source')
do forever
pos=lastpos(d2c(9),linea)
if pos>0 then do
linea=overlay(' ',linea,pos)
end
else do
leave
end
end
totalcfg=totalcfg+1
totalcfg.totalcfg=linea
if upper(word(linea,1))="#AREA" then do
Ecos=Ecos+1
Tag.Ecos=word(linea,2)
leng.Ecos=word(linea,3)
if leng.Ecos~="ESP" & leng.Ecos~="ING" then do
leng.Ecos="ING"
end
TopeDias.Ecos=word(linea,4)
if TopeDias.Ecos<=0 | datatype(TopeDias.Ecos)~="NUM" then do
TopeDias.Ecos=100
fallo="Error! en #AREA "||Tag.Ecos||" - Asigno 100 dias por defecto"
call fallos
end
Control.Ecos=subword(linea,5)
end
if upper(word(linea,1))="#BANNER1" then banner1=subword(linea,2)
if upper(word(linea,1))="#BANNER2" then banner2=subword(linea,2)
if upper(word(linea,1))="#BANNER3" then banner3=subword(linea,2)
if upper(word(linea,1))="#LOG" then do
pathlog=subword(linea,2)
if words(pathlog)=0 then pathlog="ram:MM_EstadisEcos.log"
if exists(pathlog)=0 then do
if open('source1',pathlog,'W') then do
b=writeln('source1',date('e')||' '||time()||' Creacion Fichero Log')
call close 'source1'
end
end
if exists(pathlog)=1 then do
log=date('e')||" "||time()||" MM_EstadisEcos.rexx - Entrada"
call logs
end
end
end
call close 'source'
end
totalcfg=totalcfg-1
encuentra=0
/*lee ecos y procesa*/
do x=1 to Ecos
address 'MAILMANAGER'
CALL WriteLog(' * 'Tag.x ' - Analizo')
log=date('e')||" "||time()||" * "||Tag.x||" - Analizo"
call logs
MM_SearchMsgs Tag.x 'NUM' '#?' '#?' '#?'
if RC=0 then do
do xx=0 FOR NUM.COUNT
MM_ReadMsg Tag.x NUM.xx MSG
if RC=0 then do
do i=0 for MSG.HEAD.COUNT
if pos('MSGID:',MSG.HEAD.i)>0 then do
ControlUltimo=substr(MSG.HEAD.i,2)
if Control.x=substr(MSG.HEAD.i,2) then do
encuentra=1
end
end
end
end
end
/*no ha encontrado LineaControl, procesa estadistica*/
if encuentra=0 & NUM.COUNT>0 then do
/*memoriza Control ultimo mensaje*/
Control.x=ControlUltimo
address 'MAILMANAGER'
CALL WriteLog(' * 'Tag.x ' - Proceso')
log=date('e')||" "||time()||" * "||Tag.x||" - Proceso"
call logs
/*Lectura Ecos y Analisis*/
PrimeraFecha=date('b')
De.="";Para.="";Tema.="";Fecha.="";Hora.=0;Bytes.=0;Origin.="";Quotes.=""
QuotesNom.=""
FueraDeFecha=0
MsgTotal=0
address 'MAILMANAGER'
MM_SearchMsgs Tag.x 'NUM' '#?' '#?' '#?'
if RC=0 then do
do z=0 for NUM.COUNT
MM_ReadMsg Tag.x NUM.z MSG
if RC=0 then do
Dia=word(MSG.DATE,1)
Mes=word(MSG.DATE,2)
Ano=word(MSG.DATE,3)
hora=left(word(MSG.DATE,4),2)
/*Primero investiga fecha si es antigua o futura*/
MsgTotal=MsgTotal+1
pos=pos(Mes,MesTexto);pos=pos%3+1
if Dia<1 | Dia>31 then Dia=1
if pos=0 then pos=1
if Ano<92 then Ano=92
Fecha.MsgTotal="19"||Ano||right(pos,2,0)||right(Dia,2,0)
if date('b')-date('b',Fecha.MsgTotal,'S')>TopeDias.x | date('b',Fecha.MsgTotal,'S')>date('b') then do
FueraDeFecha=FueraDeFecha+1
MsgTotal=MsgTotal-1
end
else do
/*Si fecha es razonable, sigue con el mensaje*/
de.msgtotal=MSG.FROM
para.msgtotal=MSG.TO
tema.msgtotal=MSG.SUBJ
if date('b',Fecha.MsgTotal,'S')<PrimeraFecha then do
PrimeraFecha=date('b',Fecha.MsgTotal,'S')
PrimeraFechaE=Fecha.MsgTotal
end
Hora.MsgTotal=Hora
quote=0;noquote=0
if msg.text.count=0 then MSG.TEXT.COUNT=1
do b=0 for MSG.TEXT.COUNT-1
/*recuento de bytes*/
Bytes.MsgTotal=Bytes.MsgTotal+length(MSG.TEXT.b)
/*recuento de quotes*/
If Index(left(MSG.TEXT.b,5),'>')~=0 then do
quote=quote+length(MSG.TEXT.b)
end
else do
noquote=noquote+length(MSG.TEXT.b)
end
end
if quote+noquote>0 then do
Quotes.MsgTotal=quote*100/(quote+noquote)
end
else do
Quotes.MsgTotal=0
end
QuotesNom.MsgTotal=De.MsgTotal
Origin.MsgTotal=MSG.FROMADDR
end
end
end z
end
TotalDias=date('b')-PrimeraFecha
call idioma
log=date('e')||" "||time()||" "||left(idioma.3,25,'.')||": "||MsgTotal
call logs
log=date('e')||" "||time()||" "||left(idioma.4,25,'.')||": "||trunc(MsgTotal/TotalDias,2)
call logs
log=date('e')||" "||time()||" "||left(idioma.5,25,'.')||": "||TotalDias||" - "||idioma.6||" "||date('e',PrimeraFechaE,'S')||" "||idioma.7||" "||date('e')
call logs
log=date('e')||" "||time()||" "||left(idioma.8,25,'.')||": "||FueraDeFecha||" (Max. "||TopeDias.x||" "||idioma.34||")"
call logs
log=date('e')||" "||time()||" "||left(' ',25,' ')||" ["||idioma.9||"]"
call logs
address command
if open('source','ram:Mensaje.txt','W') then do
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.1' ['Tag.x']',60))
b=writeln('source',center(idioma.2' 'date()' - 'time(),60))
b=writeln('source',copies('-',60))
b=writeln('source',center(banner1,60))
b=writeln('source',center(banner2,60))
b=writeln('source',center(banner3,60))
b=writeln('source',copies('=',60))
b=writeln('source',center(ver,60))
b=writeln('source',center('2:343/119.0@fidonet 39:190/1.0@amiganet',60))
b=writeln('source',copies('=',60))
b=writeln('source','')
b=writeln('source','')
b=writeln('source',left(idioma.3,25,'.')': 'MsgTotal)
b=writeln('source',left(idioma.4,25,'.')': 'trunc(MsgTotal/TotalDias,2))
b=writeln('source',left(idioma.5,25,'.')': 'TotalDias' - 'idioma.6' 'date('e',PrimeraFechaE,'S')' 'idioma.7' 'date('e'))
b=writeln('source',left(idioma.8,25,'.')': 'FueraDeFecha' (Max. 'TopeDias.x' 'idioma.34')')
b=writeln('source',left(' ',25,' ')' ['idioma.9']')
call close 'source'
end
veces=1;BytesTotales=0
/*Calculo MAS ESCRIBEN*/
address 'MAILMANAGER'
CALL WriteLog(' / Mas Escriben')
address command
log=date('e')||" "||time()||" / Mas Escriben"
call logs
do i= 1 to MsgTotal
if De.i~="" then do
veces=1;bytes=bytes.i
do y=i+1 to MsgTotal
if De.i=De.y then do
veces=veces+1
bytes=bytes+bytes.y
de.y=""
end
end y
De.i=right(veces,3)||" "||De.i||" "bytes
BytesTotales=BytesTotales+bytes
end
end i
/*graba en ram: para ordenacion*/
if open('source','ram:Temp0.txt','W') then do
do i = 1 to MsgTotal
b=writeln('source',De.i)
end
call close 'source'
end
'c:sort ram:Temp0.txt ram:Temp1.txt'
/*lee de ram: ya ordenado*/
if open('source','Ram:Temp1.txt') then do
do i = MsgTotal to 1 by -1
De.i=readln('source')
end
call close 'source'
end
if open('source','ram:Mensaje.txt','A') then do
b=writeln('source','')
b=writeln('source','')
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.10' ['Tag.x']',60))
b=writeln('source',copies('=',60))
b=writeln('source',' 'left(idioma.11,25)||left(idioma.12,14)||left(idioma.13,10)||idioma.14)
b=writeln('source',copies('-',60))
do i=1 to 10
if De.i~="" then do
veces=word(De.i,1)
bytes=word(De.i,words(De.i))
De.i=delword(De.i,1,1)
De.i=delword(De.i,words(De.i))
j=""
do o=1 to words(De.i)
j=j||word(De.i,o)||" "
end
De.i=j
b=writeln('source',' '||left(De.i,24,'.')' 'right(veces,3)' 'right(trunc(int(veces*100/MsgTotal+.5)),3)'% 'right(bytes,8)' 'right(trunc(int(bytes*100/BytesTotales+.5)),3)'% 'right(Bytes%veces,8))
end
end
b=writeln('source',copies('=',60))
call close 'source'
end
veces=1
/*Calculo MAS RECIBEN*/
address 'MAILMANAGER'
CALL WriteLog(' | Mas Reciben')
address command
log=date('e')||" "||time()||" | Mas Reciben"
call logs
do i= 1 to MsgTotal
if Para.i~="" then do
veces=1
do y=i+1 to MsgTotal
if Para.i=Para.y then do
veces=veces+1
Para.y=""
end
end y
Para.i=right(veces,3)||" "||Para.i
end
end i
/*graba en ram: para ordenacion*/
if open('source','ram:Temp0.txt','W') then do
do i = 1 to MsgTotal
b=writeln('source',Para.i)
end
call close 'source'
end
'c:sort ram:Temp0.txt ram:Temp1.txt'
/*lee de ram: ya ordenado*/
if open('source','Ram:Temp1.txt') then do
do i = MsgTotal to 1 by -1
Para.i=readln('source')
end
call close 'source'
end
if open('source','ram:Mensaje.txt','A') then do
b=writeln('source','')
b=writeln('source','')
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.15' ['Tag.x']',60))
b=writeln('source',copies('=',60))
b=writeln('source',' 'left(idioma.11,40)||idioma.12)
b=writeln('source',copies('-',60))
do i=1 to 10
if Para.i~="" then do
veces=word(Para.i,1)
Para.i=delword(Para.i,1,1)
j=""
do o=1 to words(Para.i)
j=j||word(Para.i,o)||" "
end
Para.i=j
b=writeln('source',copies(' ',6)||left(Para.i,38,'.')' 'right(veces,3)' 'right(trunc(int(veces*100/MsgTotal+.5)),3)'% ')
end
end
b=writeln('source',copies('=',60))
call close 'source'
end
veces=1
/*Calculo TEMAS*/
address 'MAILMANAGER'
CALL WriteLog(' | Mas Temas')
address command
log=date('e')||" "||time()||" | Mas Temas"
call logs
do i= 1 to MsgTotal
if Tema.i~="" then do
veces=1
do y=i+1 to MsgTotal
if Tema.i=Tema.y then do
veces=veces+1
Tema.y=""
end
end y
Tema.i=right(veces,3)||" "||Tema.i
end
end i
/*graba en ram: para ordenacion*/
if open('source','ram:Temp0.txt','W') then do
do i = 1 to MsgTotal
b=writeln('source',Tema.i)
end
call close 'source'
end
'c:sort ram:Temp0.txt ram:Temp1.txt'
/*lee de ram: ya ordenado*/
if open('source','Ram:Temp1.txt') then do
do i = MsgTotal to 1 by -1
Tema.i=readln('source')
end
call close 'source'
end
if open('source','ram:Mensaje.txt','A') then do
b=writeln('source','')
b=writeln('source','')
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.16' ['Tag.x']',60))
b=writeln('source',copies('=',60))
b=writeln('source',' 'left(idioma.17,39)||idioma.12)
b=writeln('source',copies('-',60))
do i=1 to 5
if Tema.i~="" then do
veces=word(Tema.i,1)
Tema.i=delword(Tema.i,1,1)
j=""
do o=1 to words(Tema.i)
j=j||word(Tema.i,o)||" "
end
Tema.i=j
b=writeln('source',copies(' ',6)||left(Tema.i,38,'.')' 'right(veces,3)' 'right(trunc(int(veces*100/MsgTotal+.5)),3)'% ')
end
end
b=writeln('source',copies('=',60))
call close 'source'
end
/*calcula QUOTES*/
veces=1
/*Calculo MAS QUOTES*/
address 'MAILMANAGER'
CALL WriteLog(' | Mas Quotes')
address command
log=date('e')||" "||time()||" | Mas Quotes"
call logs
ii=0
quotestot.=""
do i= 1 to MsgTotal
if words(quotesnom.i)>0 then do
veces=1;porcen=quotes.i
do y=i+1 to MsgTotal
if quotesnom.i=quotesnom.y then do
veces=veces+1
porcen=porcen+quotes.y
quotesnom.y=""
end
end y
ii=ii+1
quotestot.ii=right(trunc(int(porcen/veces)),3)||" "||quotesnom.i
end
end i
/*graba en ram: para ordenacion*/
if open('source','ram:Temp0.txt','W') then do
do i = 1 to ii
b=writeln('source',quotestot.i)
end
call close 'source'
end
'c:sort ram:Temp0.txt ram:Temp1.txt'
/*lee de ram: ya ordenado*/
if open('source','Ram:Temp1.txt') then do
do i = ii to 1 by -1
quotestot.i=readln('source')
end
call close 'source'
end
if open('source','ram:Mensaje.txt','A') then do
b=writeln('source','')
b=writeln('source','')
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.18' ['Tag.x']',60))
b=writeln('source',copies('=',60))
b=writeln('source',' 'left(idioma.11,36)'% 'idioma.19)
b=writeln('source',copies('-',60))
do i=1 to 10
if quotestot.i~="" then do
veces=word(quotestot.i,1)
quotestot.i=delword(quotestot.i,1,1)
j=""
do o=1 to words(quotestot.i)
j=j||word(quotestot.i,o)||" "
end
quotestot.i=j
b=writeln('source',copies(' ',6)||left(quotestot.i,38,'.')' 'right(trunc(int(veces)),3)'% ')
end
end
b=writeln('source',copies('=',60))
call close 'source'
end
/*HORAS en que se escriben mas mensajes*/
Horas.=0
address 'MAILMANAGER'
CALL WriteLog(' | Mas Horas')
address command
log=date('e')||" "||time()||" | Mas Horas"
call logs
do i=1 to MsgTotal
Hora.i=compress(hora.i)
if Hora.i>=0 & Hora.i<3 then Horas.1=Horas.1+1
if Hora.i>=3 & Hora.i<6 then Horas.2=Horas.2+1
if Hora.i>=6 & Hora.i<9 then Horas.3=Horas.3+1
if Hora.i>=9 & Hora.i<12 then Horas.4=Horas.4+1
if Hora.i>=12 & Hora.i<15 then Horas.5=Horas.5+1
if Hora.i>=15 & Hora.i<18 then Horas.6=Horas.6+1
if Hora.i>=18 & Hora.i<21 then Horas.7=Horas.7+1
if Hora.i>=21 & Hora.i<24 then Horas.8=Horas.8+1
end
if open('source','ram:Mensaje.txt','A') then do
b=writeln('source','')
b=writeln('source','')
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.20' ['Tag.x']',60))
b=writeln('source',copies('=',60))
max=0;hortot=0;porcien.=0
do i=1 to 8
if horas.i>max then max=horas.i
hortot=hortot+horas.i
end
do i=1 to 8
porcien.i=trunc(int(horas.i*100/max+.5))
end
do i=1 to 8
por=trunc(int(horas.i*100/hortot+.5))
b=writeln('source',copies(' ',6)||HoraTexto.i' 'right(por,3)'% 'copies('*',trunc(int(30*porcien.i/100+.5))))
end
b=writeln('source',copies('=',60))
call close 'source'
end
/*Dias de la SEMANA en que se escriben mas mensajes*/
Semana.=0
address 'MAILMANAGER'
CALL WriteLog(' | Mas Semanas')
address command
log=date('e')||" "||time()||" | Mas Semanas"
call logs
do i=1 to MsgTotal
Semana=date('w',Fecha.i,'S')
if semana="Monday" then Semana.1=Semana.1+1
if semana="Tuesday" then Semana.2=Semana.2+1
if semana="Wednesday" then Semana.3=Semana.3+1
if semana="Thursday" then Semana.4=Semana.4+1
if semana="Friday" then Semana.5=Semana.5+1
if semana="Saturday" then Semana.6=Semana.6+1
if semana="Sunday" then Semana.7=Semana.7+1
end
if open('source','ram:Mensaje.txt','A') then do
b=writeln('source','')
b=writeln('source','')
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.21' ['Tag.x']',60))
b=writeln('source',copies('=',60))
max=0;semtot=0;porcien.=0
do i=1 to 7
if semana.i>max then max=semana.i
semtot=semtot+semana.i
end
do i=1 to 7
porcien.i=trunc(int(semana.i*100/max+.5))
end
do i=1 to 7
por=trunc(int(semana.i*100/semtot+.5))
ii=21+i
b=writeln('source',copies(' ',6)||left(idioma.ii,11,'.')' 'right(por,3)'% 'copies('*',trunc(int(30*porcien.i/100+.5))))
end
b=writeln('source',copies('=',60))
call close 'source'
end
/*BBS que mas participan*/
address 'MAILMANAGER'
CALL WriteLog(' | BBS que Mas Participan')
address command
log=date('e')||" "||time()||" | BBS que Mas Participan"
call logs
do i=0 to MsgTotal
/*elimina de la direccion a partir del punto hasta el final*/
PosOri=pos('.',origin.i)
if PosOri>0 then do
Origin.i=left(origin.i,PosOri-1)
end
else do
/*si no hay punto mira si hay domain y borra hasta el final*/
PosOri=pos('@',origin.i)
if PosOri>0 then do
Origin.i=left(origin.i,PosOri-1)
end
end
/*pone direccion y bytes mensaje en la misma linea*/
Origin.i=Origin.i||" "||bytes.i
end
/*graba en ram: para ordenacion*/
if open('source','ram:Temp0.txt','W') then do
do i = 1 to MsgTotal
b=writeln('source',Origin.i)
end
call close 'source'
end
'c:sort ram:Temp0.txt ram:Temp1.txt'
/*lee de ram: ya ordenado*/
if open('source','Ram:Temp1.txt') then do
do i = 1 to MsgTotal
Ori.i=readln('source')
end
call close 'source'
end
OriNodo.="";OriBytes.=0;OriNum.=0
Oris=1
/*procesa porcentajes bbs que mas llaman*/
OriNodo.oris=word(ori.1,1)
OriBytes.oris=word(ori.1,2)
OriNum.oris=1
do i=1 to MsgTotal-1
ii=i+1
if word(ori.i,1)=word(ori.ii,1) then do
OriBytes.oris=OriBytes.oris+word(ori.ii,2)
OriNum.oris=OriNum.oris+1
end
else do
Oris=Oris+1
OriNodo.oris=word(ori.ii,1)
OriBytes.oris=word(ori.ii,2)
OriNum.oris=1
end
end
OriBytes=0
/*suma bytes totales*/
do i=1 to oris
/*say OriNodo.i OriBytes.i OriNum.i*/
OriBytes=OriBytes+OriBytes.i
end
/*pasa a grafica BBS que mas escriben*/
if open('source','ram:Mensaje.txt','A') then do
b=writeln('source','')
b=writeln('source','')
b=writeln('source',copies('=',60))
b=writeln('source',center(idioma.29' ['Tag.x']',60))
b=writeln('source',copies('=',60))
b=writeln('source',left(idioma.30,11)||left(idioma.31,11)||'%% 'idioma.32)
b=writeln('source',copies('-',60))
max=0;semtot=0;porcien.=0
do i=1 to oris
porNum=trunc(OriNum.i*100/MsgTotal,2)
porBytes=trunc(OriBytes.i*100/Oribytes,2)
b=writeln('source',left(OriNodo.i,11)||right(OriNum.i,7)' 'right(porNum,6)'% 'copies('*',trunc(int(33*pornum/100+.5))))
b=writeln('source',copies(' ',11)||right(OriBytes.i,7)' 'right(porBytes,6)'% 'copies('*',trunc(int(33*porBytes/100+.5))))
if i<oris then b=writeln('source','')
end
b=writeln('source',copies('=',60))
call close 'source'
end
/*Manda Mensaje*/
address 'MAILMANAGER'
mm_getsysop sysop
address command
'rx MM:Rexx/MM_SendMsg.rexx 'tag.x', 'sysop', , All, , ram:Mensaje.txt, EXPORT, 'idioma.33' ['Tag.x'] 'date()', 'idioma.1' ['Tag.x']'
/*guarda datos*/
if open('source','MM:config/MM_EstadisEcos.cfg','W') then do
do z=1 to totalcfg
if upper(word(totalcfg.z,1))="#AREA" then do
do zz=1 to ecos
if upper(word(totalcfg.z,2))=tag.zz then do
b=writeln('source',"#AREA"d2c(9)||Tag.zz||d2c(9)leng.zz||d2c(9)||topedias.zz||d2c(9)||control.zz)
end
end
end
else do
b=writeln('source',totalcfg.z)
end
end
call close 'source'
end
address 'MAILMANAGER'
CALL WriteLog(' \ Fin 'Tag.x)
log=date('e')||" "||time()||" \ Fin "||Tag.x
call logs
end
else do
address 'MAILMANAGER'
MM.LogLevel=2
CALL WriteLog(' * 'Tag.x ' - Paso')
address command
log=date('e')||" "||time()||" * "||Tag.x||" - Paso"
call logs
encuentra=0
end
end
if RC=4 then do
address 'MAILMANAGER'
CALL WriteLog(' * 'Tag.x '- Tag Incorrecto!')
log=date('e')||" "||time()||" * "||Tag.x||" - Tag Incorrecto!"
call logs
encuentra=0
end
end
/*borra ficheros temporales en ram:*/
if exists('ram:mensaje.txt')=1 then do
call delete('ram:mensaje.txt')
end
if exists('ram:Temp0.txt')=1 then do
call delete('ram:Temp0.txt')
end
if exists('ram:Temp1.txt')=1 then do
call delete('ram:Temp1.txt')
end
address 'MAILMANAGER'
r=time('e');h=trunc(int(r/60/60));m=trunc(int(r/60));s=trunc(int(r//60))
tim=right(h,2,'0')||":"||right(m,2,'0')||":"||right(s,2,'0')
CALL WriteLog(' Procesado en 'tim)
CALL WriteLog('MM_EstadisEcos.rexx - Salida')
log=date('e')||" "||time()||" Procesado en "||tim
call logs
log=date('e')||" "||time()||" MM_EstadisEcos.rexx - Salida"
call logs
exit
WriteLog: PROCEDURE EXPOSE MM.
PARSE ARG Testo
address 'MAILMANAGER'
MM_WriteLog 'Testo' MM.LogLevel
address command
RETURN
/*========================================================================*/
/*Lee Textos Idioma MM_EstadisEcos.xxx*/
idioma:
if exists('MM:config/MM_EstadisEcos.'leng.x)=0 then do
fallo="Error! No encuentro MM:config/MM_EstadisEcos."||leng.x
call fallos
exit
end
lin=34 /* numero de lineas idioma */
if open('source','MM:config/MM_EstadisEcos.'leng.x) then do
do z=1 to lin
idioma.z=readln('source')
end
call close 'source'
end
return ok
/*log*/
logs:
if open('source1',pathlog,'A') then do
b=writeln('source1',log)
call close 'source1'
end
return ok
/*errores*/
fallos:
address 'MAILMANAGER'
CALL WriteLog(fallo)
log=date('e')||" "||time()||" "||fallo
call logs
return ok
/*========================================================================*/
break_c:
exit
halt:
syntax:
error:
ioerr:
syntax:
parse source cadena
name=upper(result)
fallo="ERROR! Linea: "||sigl||" Error: "||rc||" "||errortext(rc)
call fallos
fallo="Avisa al Autor!"
call fallos
exit